package com.maiyawx.mall.service;

import com.maiyawx.mall.mapper.BlacklistMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;

/**
 * 黑名单服务
 */
@Service
public class BlacklistService {
    @Autowired
    private BlacklistMapper blacklistMapper;

    /**
     * 查询用户是否在黑名单中
     *
     * @param appid
     * @param userId
     * @return
     */
    public Boolean hasUser(String appid, Integer userId)
    {
        Map<String,Object> map = new HashMap<String, Object>();
        map.put("appid", appid);
        map.put("userId", userId);
        return blacklistMapper.hasUser(map);
    }
}
